﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Hkwl.WorldExpo.Merchant.Common
{
    public class MD5
    {
        public static string MD5_32(string str)
        {
            string convertStr;
            convertStr = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(str, "MD5");
            return convertStr;
        }


        public static string MD5_16(string str)
        {
            System.Security.Cryptography.MD5CryptoServiceProvider md5 = new System.Security.Cryptography.MD5CryptoServiceProvider();
            string t2 = BitConverter.ToString(md5.ComputeHash(UTF8Encoding.Default.GetBytes(str)), 4, 8);
            t2 = t2.Replace("-", "");
            return t2;
        }
    }
}
